<?php
declare(strict_types=1);

namespace App\Resource\LotteryTurntable\App;


use Illuminate\Http\Resources\Json\JsonResource;

class Resource extends JsonResource
{
    public function toArray($request): array
    {
        return [
            "id" => $this->id,
            "name" => $this->name,
            "icon" => $this->icon,
            "balance_icon" => $this->balance_icon,
            "balance_coin" => $this->balance_coin,
            "button" => json_decode($this->button,true),
            "prizes" => RewardResource::collection($this->prizes),
            "user" => \App\Resource\LotteryTurntable\Balance\Resource::make($this->user),
        ];
    }

}